home *** CD-ROM | disk | FTP | other *** search
/ Champak 130 / Vol 130.iso / games / atlantis.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2008-11-13  |  15.4 KB  |  229 lines

  1. function GetVar(N)
  2. {
  3.    if(_root[N] != undefined)
  4.    {
  5.       return _root[N];
  6.    }
  7.    if(_global[N] != undefined)
  8.    {
  9.       return _global[N];
  10.    }
  11.    return "0";
  12. }
  13. function Loading()
  14. {
  15.    if(GetVar("bypass") == "true")
  16.    {
  17.       KB._visible = false;
  18.       loadbar._visible = false;
  19.       l1._x += 100;
  20.       l2._x -= 100;
  21.    }
  22.    else
  23.    {
  24.       loadline._visible = true;
  25.       clearInterval(SSS);
  26.       Load = _root.getBytesLoaded();
  27.       Total = _root.getBytesTotal();
  28.       KB.text = "Loading... (" + Math.round(100 * Load / Total) + "%)";
  29.    }
  30.    if(Total <= Load)
  31.    {
  32.       loadline._xscale = 100 * Load / Total;
  33.       seconds = Number(seconds) * 1000;
  34.       ID = setInterval(function()
  35.       {
  36.          clearInterval(ID);
  37.          gotoAndStop(3);
  38.       }
  39.       ,seconds);
  40.    }
  41.    else
  42.    {
  43.       loadline._xscale = 100 * Load / Total;
  44.       SSS = setInterval(Loading,500);
  45.    }
  46.    updateAfterEvent();
  47. }
  48. function initoptXML(xml)
  49. {
  50.    var _loc7_ = xml.firstChild;
  51.    var _loc5_ = _loc7_.firstChild;
  52.    seconds = _loc5_.firstChild.firstChild.toString();
  53.    nagtime = _loc5_.firstChild.nextSibling.firstChild.toString();
  54.    if(Boolean(GetVar(alawar_f)))
  55.    {
  56.       nagtime = 0;
  57.    }
  58.    linklogo1 = _loc5_.firstChild.nextSibling.nextSibling.firstChild.toString();
  59.    linklogo2 = _loc5_.lastChild.firstChild.toString();
  60.    var _loc6_ = _loc5_.nextSibling;
  61.    var _loc4_ = _loc6_.childNodes;
  62.    j = 0;
  63.    while(j < 7)
  64.    {
  65.       er = _loc4_[j].firstChild.toString();
  66.       _root["menubutton" + j] = er;
  67.       j++;
  68.    }
  69.    var _loc8_ = _loc6_.nextSibling;
  70.    var _loc3_ = _loc8_.childNodes;
  71.    j = 0;
  72.    while(j < _loc3_.length)
  73.    {
  74.       er = _loc3_[j].firstChild.toString();
  75.       _root["hint" + j] = er;
  76.       j++;
  77.    }
  78.    var _loc2_ = _loc8_.nextSibling;
  79.    downloadlink = _loc2_.firstChild.toString();
  80.    _loc2_ = _loc2_.nextSibling;
  81.    morelink = _loc2_.firstChild.toString();
  82.    if(GetVar("link") != "0")
  83.    {
  84.       downloadlink = GetVar("link");
  85.       morelink = GetVar("link");
  86.    }
  87.    _loc2_ = _loc2_.nextSibling;
  88.    nolife = _loc2_.firstChild.toString();
  89.    _loc2_ = _loc2_.nextSibling;
  90.    onelife = _loc2_.firstChild.toString();
  91.    _loc2_ = _loc2_.nextSibling;
  92.    manylives = _loc2_.firstChild.toString();
  93.    _loc2_ = _loc2_.nextSibling;
  94.    fast = _loc2_.firstChild.toString();
  95.    _loc2_ = _loc2_.nextSibling;
  96.    normal = _loc2_.firstChild.toString();
  97.    _loc2_ = _loc2_.nextSibling;
  98.    slow = _loc2_.firstChild.toString();
  99.    _loc2_ = _loc2_.nextSibling;
  100.    texttiles = _loc2_.firstChild.toString();
  101.    _loc2_ = _loc2_.nextSibling;
  102.    textmatches = _loc2_.firstChild.toString();
  103.    _loc2_ = _loc2_.nextSibling;
  104.    textchain = _loc2_.firstChild.toString();
  105.    _loc2_ = _loc2_.nextSibling;
  106.    texttime = _loc2_.firstChild.toString();
  107.    _loc2_ = _loc2_.nextSibling;
  108.    textbonus = _loc2_.firstChild.toString();
  109.    _loc2_ = _loc2_.nextSibling;
  110.    textscore = _loc2_.firstChild.toString();
  111.    _loc2_ = _loc2_.nextSibling;
  112.    textseconds = _loc2_.firstChild.toString();
  113.    _loc2_ = _loc2_.nextSibling;
  114.    nagdownload = _loc2_.firstChild.toString();
  115.    _loc2_ = _loc2_.nextSibling;
  116.    nagmore = _loc2_.firstChild.toString();
  117.    _loc2_ = _loc2_.nextSibling;
  118.    nagcontinue = _loc2_.firstChild.toString();
  119.    _loc2_ = _loc2_.nextSibling;
  120.    nagrestart = _loc2_.firstChild.toString();
  121.    _loc2_ = _loc2_.nextSibling;
  122.    textcontinue = _loc2_.firstChild.toString();
  123.    _loc2_ = _loc2_.nextSibling;
  124.    texthelpclick = _loc2_.firstChild.toString();
  125.    _loc2_ = _loc2_.nextSibling;
  126.    textgameover = _loc2_.firstChild.toString();
  127.    help = _loc7_.lastChild;
  128.    ahelp = help.childNodes;
  129.    j = 0;
  130.    while(j < ahelp.length)
  131.    {
  132.       er = ahelp[j].firstChild.toString();
  133.       _root["helping" + j] = er;
  134.       j++;
  135.    }
  136. }
  137. function initcountXML(xml)
  138. {
  139.    var _loc3_ = xml.firstChild;
  140.    if(_loc3_ != undefined)
  141.    {
  142.       loadbar._visible = true;
  143.       map = new Array();
  144.       countries = new Array();
  145.       sities = new Array();
  146.       artdescription = new Array();
  147.       var _loc2_ = _loc3_.childNodes;
  148.       sities = new Array(_loc2_.length);
  149.       sitytime = new Array(_loc2_.length);
  150.       i = 0;
  151.       while(i < _loc2_.length)
  152.       {
  153.          var _loc1_ = _loc2_[i].childNodes;
  154.          country = new Array();
  155.          countryname = _loc2_[i].attributes.name;
  156.          artdesc = _loc2_[i].attributes.description;
  157.          countries.push(countryname);
  158.          artdescription.push(artdesc);
  159.          asityname = new Array();
  160.          atime = new Array();
  161.          j = 0;
  162.          while(j < _loc1_.length)
  163.          {
  164.             ast = _loc1_[j].childNodes;
  165.             sity = new Array();
  166.             sityname = _loc1_[j].attributes.name;
  167.             timesity = _loc1_[j].attributes.time;
  168.             atime.push(timesity);
  169.             asityname.push(sityname);
  170.             k = 0;
  171.             while(k < ast.length)
  172.             {
  173.                aline = ast[k].firstChild.toString().split(" ");
  174.                sity.push(aline);
  175.                k++;
  176.             }
  177.             country.push(sity);
  178.             sities[i] = asityname;
  179.             sitytime[i] = atime;
  180.             j++;
  181.          }
  182.          map.push(country);
  183.          i++;
  184.       }
  185.       Loading();
  186.    }
  187.    else
  188.    {
  189.       KB.text = "Unable to init game";
  190.    }
  191. }
  192. function LoadXML()
  193. {
  194.    var _loc2_ = new XML(TEXToptions);
  195.    _loc2_.ignoreWhite = true;
  196.    initoptXML(_loc2_);
  197.    var _loc1_ = new XML(TEXTcountries);
  198.    _loc1_.ignoreWhite = true;
  199.    initcountXML(_loc1_);
  200. }
  201. TEXTcountries = "<?xml version=\"1.0\" encoding=\"utf-8\"?><countries><country name=\"Greece\" description=\"The amphora of Dyonysus,|the Greek god of wine, who|introduced the peoples of|many lands to the cultivation|of the vine. This unique|amphora is said to be able|to turn water into wine\"><sity name=\"Arta\" time=\"600\"><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 a1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st></sity><sity name=\"Athens\" time=\"500\"><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 a2 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 a3 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st></sity><sity name=\"Sparta\" time=\"520\"><st>1 1 1 a4 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 a5 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 b1 1 1 1 1</st><st>1 1 1 1 1 a6 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st></sity><sity name=\"Troy\" time=\"500\"><st>0 0 0 1 1 0 0 0</st><st>1 1 0 1 1 0 1 1</st><st>1 1 0 a8 1 0 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 a9 1</st><st>1 a7 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 0</st></sity><sity name=\"Katerini\" time=\"380\"><st>0 0 1 1 1 1 0 0</st><st>0 1 1 1 1 1 a12 0</st><st>0 a10 1 1 1 1 1 0</st><st>0 1 1 1 a11 1 1 0</st><st>0 1 1 1 1 1 1 0</st><st>0 1 1 1 1 1 1 0</st><st>1 1 1 b2 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 0 1 1 1 1 0 0</st></sity><sity name=\"Mytilene\" time=\"340\"><st>0 0 1 1 b3 1 1 0 0</st><st>0 1 1 1 1 a16 1 1 0</st><st>a13 1 1 1 1 1 1 1 a15</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>0 1 1 1 a14 1 1 1 0</st><st>0 0 1 1 1 1 1 0 0</st></sity></country><country name=\"Babylon\" description=\"The Shield of Nebuchadnezzar,|the greatest of all the|Babylonian kings. He conquered|many territories, brought Syria|and Phoenicia under the sway of|Babylon, subdued the whole of|Palestine, and took Jerusalem.\"><sity name=\"Ture\" time=\"600\"><st>0 0 a2 1 1 1 1 0 0</st><st>0 0 1 1 1 1 1 0 0</st><st>1 a1 1 1 1 1 1 1 1</st><st>1 1 1 1 a3 1 1 a4 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 x1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>0 0 1 1 1 b1 1 0 0</st><st>0 0 1 1 1 1 1 0 0</st></sity><sity name=\"Edom\" time=\"550\"><st>0 0 1 0 0 0 1 0 0</st><st>0 1 1 1 0 1 1 1 0</st><st>1 a5 1 1 1 1 1 a8 1</st><st>b2 1 1 a6 1 a7 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 0 0 0 1 0 0 0 0</st></sity><sity name=\"Emar\" time=\"470\"><st>0 0 a13 1 0 1 1 0 0</st><st>0 1 1 a10 0 1 1 1 0</st><st>1 1 1 1 0 b2 1 1 1</st><st>1 a9 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 a12 1 1</st><st>1 1 1 x5 1 1 1 1 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 1 a11 1 1 1 x1 1 0</st><st>0 0 1 1 1 1 1 0 0</st></sity><sity name=\"Samaria\" time=\"440\"><st>0 0 0 1 1 1 1 a16 0</st><st>0 0 0 1 x5 1 1 1 1</st><st>1 a18 1 1 a15 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 a17</st><st>1 1 b3 1 1 1 1 1 1</st><st>1 1 1 1 1 a14 1 1 1</st><st>1 1 1 x5 1 1 0 0 0</st><st>0 1 1 1 1 1 0 0 0</st></sity><sity name=\"Kish\" time=\"420\"><st>0 0 0 0 0 0 0 1 1</st><st>0 0 0 0 0 0 a20 1 1</st><st>0 0 0 0 0 1 1 1 1</st><st>0 0 0 0 a22 1 1 1 1</st><st>0 0 0 1 1 1 1 1 1</st><st>0 0 a19 1 1 1 1 1 a21</st><st>0 1 1 1 1 1 1 1 1</st><st>1 a23 1 1 b4 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st></sity><sity name=\"Assyria\" time=\"410\"><st>a26 1 1 x1 0 0 0 0</st><st>1 1 1 1 a25 0 0 0</st><st>1 1 1 1 1 1 0 0</st><st>1 1 1 1 1 1 a27 0</st><st>1 1 a24 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 0</st><st>b1 1 1 1 1 1 0 0</st><st>1 1 1 1 1 0 0 0</st></sity><sity name=\"Babylon\" time=\"430\"><st>1 0 0 a29 a28 0 0 1</st><st>a31 1 0 1 1 0 1 1</st><st>1 1 1 1 x3 1 1 1</st><st>1 1 1 1 1 1 a30 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 b2 1 1 1 1 a32</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 1 0 1 1 0 1 0</st></sity><sity name=\"Susa\" time=\"350\"><st>a33 0 0 0 0 0 0 0 0</st><st>1 1 1 0 0 0 0 0 0</st><st>1 1 1 1 1 0 0 0 0</st><st>1 1 a34 1 1 1 1 0 0</st><st>a37 1 1 1 a35 1 1 1 1</st><st>1 1 1 1 1 1 x5 1 1</st><st>0 1 1 b1 1 1 x1 a36 1</st><st>0 0 0 1 1 1 x2 1 1</st><st>0 0 0 0 0 1 1 1 1</st></sity></country><country name=\"Egypt\" description=\"The Statue of Horus Behudety,|the falcon headed god of midday|sun, venerated as a victorious|warlord who fought a great|battle against Seth and an|army of conspirators.\"><sity name=\"Memphis\" time=\"390\"><st>0 0 0 0 a2 0 0 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 0 1 1 1 1 a3 0 0</st><st>0 1 1 1 1 1 1 1 0</st><st>1 a1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 0 0 0 x5 0 0 0 0</st></sity><sity name=\"Siwa\" time=\"370\"><st>0 0 0 1 a5 1 0 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 a4 1 1 1 1 1 1 0</st><st>0 1 1 1 1 1 1 a6 0</st><st>0 1 1 1 x5 1 1 1 0</st><st>0 1 1 1 1 b4 1 1 0</st><st>0 1 1 1 1 1 1 1 0</st><st>0 1 x6 1 1 1 1 1 0</st><st>1 1 1 0 0 0 1 1 1</st></sity><sity name=\"Saggara\" time=\"440\"><st>1 a7 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 a9 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 1 1 1 a8 1 1 1 0</st><st>0 1 x6 1 1 1 x5 1 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 b1 1 1 1 1 0 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 0 1 x6 1 0 0 0</st></sity><sity name=\"Amarna\" time=\"390\"><st>0 0 1 1 a11 1 1 0 0</st><st>0 1 1 1 1 1 1 1 0</st><st>a1 1 1 b3 1 1 1 a12 1</st><st>1 1 1 1 1 1 1 1 b2</st><st>1 1 1 1 1 1 1 1 1</st><st>x6 1 1 1 x5 1 1 1 1</st><st>0 1 1 1 0 1 x1 1 0</st><st>0 0 1 1 0 1 1 0 0</st></sity><sity name=\"Karnak\" time=\"460\"><st>0 1 0 0 0 0 1 0</st><st>0 1 1 0 0 1 1 0</st><st>0 1 1 0 0 1 a15 0</st><st>a13 1 1 a14 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 b2 1 1 1 x6</st><st>1 1 1 1 1 1 1 1</st><st>0 x2 1 1 1 1 1 0</st></sity><sity name=\"Sohag\" time=\"460\"><st>a16 1 1 0 0 a18 1 1</st><st>1 1 1 0 0 1 1 1</st><st>1 1 1 0 0 1 1 1</st><st>1 1 a17 0 0 1 1 1</st><st>1 1 1 0 0 1 1 1</st><st>1 1 1 0 0 1 1 b3</st><st>1 1 1 0 0 1 1 1</st><st>1 1 1 1 1 a19 1 1</st><st>1 1 x5 1 1 1 1 x6</st></sity><sity name=\"Suez\" time=\"370\"><st>0 0 0 1 a22 0 0 0</st><st>0 1 1 1 1 1 1 0</st><st>1 a21 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 a23</st><st>1 1 1 1 1 1 1 1</st><st>a20 x6 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 0</st><st>0 0 0 1 x2 0 0 0</st></sity><sity name=\"Dahab\" time=\"350\"><st>0 1 a25 1 0 a26 1 1 0</st><st>a24 1 1 1 0 1 1 1 a27</st><st>1 1 1 1 b2 1 1 1 1</st><st>1 1 1 1 1 b1 1 1 1</st><st>1 1 1 x2 1 1 1 1 1</st><st>1 1 1 1 0 1 1 x1 1</st><st>1 1 1 1 0 1 1 1 1</st><st>1 1 1 0 0 0 1 1 1</st></sity><sity name=\"Hurghada\" time=\"310\"><st>0 0 1 x5 x6 1 0 0</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 a28 1 1 1 1</st><st>1 1 1 1 a29 x2 1 1</st><st>1 x5 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 a30 1 1</st><st>1 1 x5 1 1 x6 1 1</st><st>0 0 x6 1 1 x5 0 0</st></sity></country></countries>";
  202. TEXToptions = "<?xml version=\"1.0\" encoding=\"utf-8\"?><option><intro><loadsec>4</loadsec><nag>2</nag><logo1>logo1.swf</logo1><logo2>logo2.swf</logo2></intro><menu><button>How to play</button><button>Sound on</button><button>full version</button><button>New game</button><button>Resume</button><button>Sound off</button><button>Exit</button></menu><hints><hint>Form matches of three in-a-row by|swapping adjacent tiles. For example,|these flashing tiles can be swapped</hint><hint>Drive this piece to the bottom of the|game field by getting rid of tiles|under it and you will see it added to|the artifact outline on the left</hint><hint>Tiles can only be swapped if it|results in matching three in-a-row</hint><hint>Finish the level by dropping all|the pieces of the artifact to the|bottom of the game field</hint><hint>Pay attention!|You have not much time left</hint><hint>A hammer bonus. Drive it to the|bottom to be able to use it.|It can destroy a particular|inconvenient tile</hint><hint>A spade bonus. Use it to destroy|the tiles right underneath the|pieces of the artifact</hint><hint>A clock bonus. Use it when time|is almost up to receive some|extra time</hint><hint>A magic lamp bonus. Use it to|change all the tiles around|the piece of the artifact</hint><hint>Click on the Hammer to pick it|up and point to the tile|you want to smash</hint><hint>Click on the Spade to dig under|all the pieces of the artifact|currently on the game field</hint><hint>Click on the Clock to get some|extra time when it begins to|run out</hint><hint>Click on the Magic Lamp to|change all the tiles around|the pieces of the artifact</hint></hints><downloadlink>http://playrix.com/atlantis-quest.html</downloadlink><link>http://playrix.com/atlantis-quest.html</link><nolife>No extra lifes left</nolife><onelife>One extra life left</onelife><manylives> extra lives left</manylives><fast>excellent</fast><normal>well done</normal><slow>you did it</slow><tiles>tiles</tiles><matches>matches</matches><chain>max chain</chain><time>your time</time><timebonus>time bonus</timebonus><score>score</score><textseconds>s</textseconds><nagdownload>download now</nagdownload><nagmore>tell me more</nagmore><nagcontinue>back to game</nagcontinue><nagrestart>start over</nagrestart><continue>continue</continue><helpclick>click to play</helpclick><gameover>game over</gameover><help><hlp>Use the left mouse|button to swap tiles</hlp><hlp>Move tiles into matches|of 3 or more in a line|horizontally or verticaly</hlp><hlp>Assemble the Artifact|by freeing the pieces|throught the bottom</hlp><hlp>Free the bonuses.|They will help you</hlp></help></option>";
  203. Stage.showMenu = false;
  204. Stage.scaleMode = "noScale";
  205. oKey.onKeyDown = function()
  206. {
  207.    if(Key.isDown(38) && Key.getAscii() == String("s").charCodeAt())
  208.    {
  209.       trace("qq");
  210.    }
  211. };
  212. Key.addListener(oKey);
  213. stop();
  214. loadline._visible = false;
  215. loadbar._visible = false;
  216. if(getVersion().substr(getVersion().indexOf(" ") + 1,1) > 6)
  217. {
  218.    ststst = "";
  219.    cntr = ststst + "countries.xml";
  220.    opt = ststst + "option.xml";
  221.    LoadXML();
  222. }
  223. else
  224. {
  225.    KB._visible = true;
  226.    KB.text = "Please update the player version to 7";
  227. }
  228. this._lockroot = true;
  229.